-- @owner: cr13
-- @date: 2023-05-12
-- @testpoint: opengauss关键字aggregate(非保留)，作为函数名，合理报错

--step1:关键字不带引号 expect:合理报错
create or replace function aggregate(i integer)
returns integer
as $$
begin
    return i+1;
end;
$$ language plpgsql;
/

--step2:关键字带双引号 expect:成功
create or replace function "aggregate"(i integer)
returns integer
as $$
begin
    return i+1;
end;
$$ language plpgsql;
/

--step3:关键字带单引号 expect:合理报错
create or replace function 'aggregate'(i integer)
returns integer
as $$
begin
    return i+1;
end;
$$ language plpgsql;
/

--step4:关键字带反引号 expect:合理报错
create or replace function `aggregate`(i integer)
returns integer
as $$
begin
    return i+1;
end;
$$ language plpgsql;
/

--step5:清理环境 expect:成功
drop function aggregate;